package com.mib.browser;

import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.EventListener;

public class PropertyTableRenderer extends JLabel implements TableCellRenderer {
    public PropertyTableRenderer() {
        this.setOpaque(true);
    }

    public Component getTableCellRendererComponent(JTable table, Object color, boolean isSelected, boolean hasFocus, int row, int column) {
        if (row % 2 == 1) {
            this.setBackground(new Color(246, 248, 246));
        } else {
            this.setBackground(Color.WHITE);
        }

        if (table.getValueAt(row, column) != null) {
            String str = table.getValueAt(row, column).toString();
            this.setText(" " + str);
        }

        return this;
    }
}
